import {ref, h,render, watchEffect} from '@vue/runtime-dom'

let app=document.querySelector("#app");
const title=ref("h函数生成VNode,中需要引入@vue/runtime-dom");

function createRoot(){
  const root=h('div',{},[]);
  const h1=h('h1',{},title.value)
  root.children.push(h1);
  const button=h('button',{"onclick":()=>title.value=Math.random()},"改变");
  root.children.push(button);
  return root;
}

watchEffect(()=>render(createRoot(),app));